var dataList = null;
var curItemId = 1;
$(function(){ 
	dataList = new Array();
	dataList.push({name:'img1',path:'images/1.png'});
	dataList.push({name:'img2',path:'images/2.jpg'});
	dataList.push({name:'img3',path:'images/3.png'});
	curItemId = 2;
	
	var con = '',data,j;
	for(var i = curItemId-1;i<=curItemId+1;i++){
		if(i>dataList.length){
			j = 1;
		}else if(i<1){
			j = dataList.length;
		}else{
			j = i;
		}
		con += '<div><img src="'+dataList[j-1].path+'"/></div>';
	}
	$('#imgList').html(con);
});